home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 34.zip / BS1 part 34 / FredFish PD 316.adf / SmartIcon / src / window.c < prev   
C/C++ Source or Header  |  1990-02-06  |  18KB  |  468 lines

  1. #include "list.h"
  2. #include <graphics/gfxmacros.h>
  3. #include "menu.h"
  4.  
  5. #ifndef DEBUG
  6. #include <proto/all.h>
  7. #endif
  8.  
  9.  
  10. USHORT chip is_PropEndData[] =
  11.    {
  12.    0x0000, 0x8000,    /* ................#............... */
  13.    0x7ffe, 0x0000,    /* .##############................. */
  14.    0x7ffe, 0x0000,    /* .##############................. */
  15.    0x8000, 0x0000,    /* #............................... */
  16.  
  17.    0x0000, 0x0000,    /* ................................ */
  18.    0x0000, 0x8000,    /* ................#............... */
  19.    0x0000, 0x8000,    /* ................#............... */
  20.    0x2aaa, 0x8000,    /* ..#.#.#.#.#.#.#.#............... */
  21.    };
  22.  
  23. USHORT chip is_PropArrowsData[] =
  24.    {
  25.    0x0000, 0x8000,    /* ................#............... */
  26.    0x7ffe, 0x0000,    /* .##############................. */
  27.    0x7ffe, 0x0000,    /* .##############................. */
  28.    0x7e7e, 0x0000,    /* .######..######................. */
  29.    0x7c3e, 0x0000,    /* .#####....#####................. */
  30.    0x781e, 0x0000,    /* .####......####................. */
  31.    0x7ffe, 0x0000,    /* .##############................. */
  32.    0x7ffe, 0x0000,    /* .##############................. */
  33.    0x0000, 0x0000,    /* ................................ */
  34.    0x7ffe, 0x0000,    /* .##############................. */
  35.    0x7ffe, 0x0000,    /* .##############................. */
  36.    0x0000, 0x0000,    /* ................................ */
  37.    0x7ffe, 0x0000,    /* .##############................. */
  38.    0x7ffe, 0x0000,    /* .##############................. */
  39.    0x781e, 0x0000,    /* .####......####................. */
  40.    0x7c3e, 0x0000,    /* .#####....#####................. */
  41.    0x7e7e, 0x0000,    /* .######..######................. */
  42.    0x7ffe, 0x0000,    /* .##############................. */
  43.    0x7ffe, 0x0000,    /* .##############................. */
  44.    0x8000, 0x0000,    /* #............................... */
  45.  
  46.    0x0000, 0x0000,    /* ................................ */
  47.    0x0000, 0x8000,    /* ................#............... */
  48.    0x0000, 0x8000,    /* ................#............... */
  49.    0x0180, 0x8000,    /* .......##.......#............... */
  50.    0x03c0, 0x8000,    /* ......####......#............... */
  51.    0x07e0, 0x8000,    /* .....######.....#............... */
  52.    0x0000, 0x8000,    /* ................#............... */
  53.    0x0000, 0x8000,    /* ................#............... */
  54.    0x0000, 0x8000,    /* ................#............... */
  55.    0x0000, 0x8000,    /* ................#............... */
  56.    0x0000, 0x8000,    /* ................#............... */
  57.    0x0000, 0x8000,    /* ................#............... */
  58.    0x0000, 0x8000,    /* ................#............... */
  59.    0x0000, 0x8000,    /* ................#............... */
  60.    0x07e0, 0x8000,    /* .....######.....#............... */
  61.    0x03c0, 0x8000,    /* ......####......#............... */
  62.    0x0180, 0x8000,    /* .......##.......#............... */
  63.    0x0000, 0x8000,    /* ................#............... */
  64.    0x0000, 0x8000,    /* ................#............... */
  65.    0x2aaa, 0x8000,    /* ..#.#.#.#.#.#.#.#............... */
  66.    };
  67.  
  68. /* === Read Only Data ================================================== */
  69.  
  70. static USHORT chip Close1Data[] =
  71.    {
  72.    0xffff,    /* ################ */
  73.    0xc003,    /* ##............## */
  74.    0xcff3,    /* ##..########..## */
  75.    0xcff3,    /* ##..########..## */
  76.    0xcff3,    /* ##..########..## */
  77.    0xcff3,    /* ##..########..## */
  78.    0xc003,    /* ##............## */
  79.    0xffff,    /* ################ */
  80.  
  81.    0x0000,    /* ................ */
  82.    0x3ffc,    /* ..############.. */
  83.    0x300c,    /* ..##........##.. */
  84.    0x300c,    /* ..##........##.. */
  85.    0x300c,    /* ..##........##.. */
  86.    0x300c,    /* ..##........##.. */
  87.    0x3ffc,    /* ..############.. */
  88.    0x0000,    /* ................ */
  89.    };
  90.  
  91. static USHORT chip Close2Data[] =
  92.    {
  93.    0xffff,    /* ################ */
  94.    0xc003,    /* ##............## */
  95.    0xc3c3,    /* ##....####....## */
  96.    0xcdb3,    /* ##..##.##.##..## */
  97.    0xcdb3,    /* ##..##.##.##..## */
  98.    0xc3c3,    /* ##....####....## */
  99.    0xc003,    /* ##............## */
  100.    0xffff,    /* ################ */
  101.  
  102.    0x0000,    /* ................ */
  103.    0x3ffc,    /* ..############.. */
  104.    0x3c3c,    /* ..####....####.. */
  105.    0x324c,    /* ..##..#..#..##.. */
  106.    0x324c,    /* ..##..#..#..##.. */
  107.    0x3c3c,    /* ..####....####.. */
  108.    0x3ffc,    /* ..############.. */
  109.    0x0000,    /* ................ */
  110.    };
  111.  
  112. static USHORT chip Depth1Data[] =
  113.    {
  114.    0xffff,    /* ################ */
  115.    0xc03f,    /* ##........###### */
  116.    0xcf3f,    /* ##..####..###### */
  117.    0xcc03,    /* ##..##........## */
  118.    0xc003,    /* ##............## */
  119.    0xfc03,    /* ######........## */
  120.    0xfc03,    /* ######........## */
  121.    0xffff,    /* ################ */
  122.  
  123.    0x0000,    /* ................ */
  124.    0x3fc0,    /* ..########...... */
  125.    0x30c0,    /* ..##....##...... */
  126.    0x33fc,    /* ..##..########.. */
  127.    0x3ffc,    /* ..############.. */
  128.    0x03fc,    /* ......########.. */
  129.    0x03fc,    /* ......########.. */
  130.    0x0000,    /* ................ */
  131.    };
  132.  
  133. static USHORT chip Depth2Data[] =
  134.    {
  135.    0xffff,    /* ################ */
  136.    0xc03f,    /* ##........###### */
  137.    0xc03f,    /* ##........###### */
  138.    0xc003,    /* ##............## */
  139.    0xc0f3,    /* ##......####..## */
  140.    0xfcf3,    /* ######..####..## */
  141.    0xfc03,    /* ######........## */
  142.    0xffff,    /* ################ */
  143.  
  144.    0x0000,    /* ................ */
  145.    0x3fc0,    /* ..########...... */
  146.    0x3fc0,    /* ..########...... */
  147.    0x3ffc,    /* ..############.. */
  148.    0x3f0c,    /* ..######....##.. */
  149.    0x030c,    /* ......##....##.. */
  150.    0x03fc,    /* ......########.. */
  151.    0x0000,    /* ................ */
  152.    };
  153.  
  154. static USHORT chip SizeData[] =
  155.    {
  156.    0xfcff,    /* ######..######## */
  157.    0xf3ff,    /* ####..########## */
  158.    0xccff,    /* ##..##..######## */
  159.    0x30ff,    /* ..##....######## */
  160.    0xffff,    /* ################ */
  161.  
  162.    0x0300,    /* ......##........ */
  163.    0x0c00,    /* ....##.......... */
  164.    0x3300,    /* ..##..##........ */
  165.    0xcf00,    /* ##..####........ */
  166.    0x0000,    /* ................ */
  167.    };
  168.  
  169. static struct   Image   Close1    = { 0,0, 16,8, 2, Close1Data, 0x03,0x00, NULL };
  170. static struct   Image   Close2    = { 0,0, 16,8, 2, Close2Data, 0x03,0x00, NULL };
  171. static struct   Image   Depth1    = { 0,0, 16,8, 2, Depth1Data, 0x03,0x00, NULL };
  172. static struct   Image   Depth2    = { 0,0, 16,8, 2, Depth2Data, 0x03,0x00, NULL };
  173. static struct   Gadget  SystemGadgets[] =
  174.    {
  175.       { &SystemGadgets[1], -19, 1, 16, 8, GRELRIGHT | GADGIMAGE | GADGHCOMP, RELVERIFY,
  176.         SYSGADGET | WUPFRONT, (APTR)&Depth1, NULL, NULL, NULL, NULL, 0, NULL },
  177.       { &SystemGadgets[2], -39, 1, 16, 8, GRELRIGHT | GADGIMAGE | GADGHCOMP, RELVERIFY,
  178.         SYSGADGET | WDOWNBACK, (APTR)&Depth2, NULL, NULL, NULL, NULL, 0, NULL },
  179.       { NULL, 4, 1, 16, 8, GADGIMAGE | GADGHIMAGE, RELVERIFY,
  180.         SYSGADGET | CLOSE, (APTR)&Close1, (APTR)&Close2, NULL, NULL, NULL, 0, NULL },
  181.    };
  182.  
  183. struct   Border   st_LRBorder[] =
  184.    {
  185.       { 0, 0, BLACK, 0, JAM1, 4, NULL, NULL },   /* Window Border     */
  186.       { 0, 0, BLACK, 0, JAM1, 5, NULL, NULL },   /* Window Border     */
  187.       { 0, 0, BLUE,  0, JAM1, 2, NULL, NULL },   /* Prop left border  */
  188.    };
  189.  
  190. struct   Box      st_LRBox[] =
  191.    {
  192.       { NULL, 1, 0,   0,10, BLACK, BLACK, WHITE, 0, NULL, NULL }, /* Title */
  193. /*
  194.       { NULL,  0,0,  62,13,  BLUE, WHITE, BLACK, BLACK, "Cancel", BOX_SHADING },
  195.       { NULL, 17,0,  62,13, YELLW, WHITE, BLACK, BLACK, "Ok",     BOX_SHADING },
  196. */
  197.       { NULL,  0,0,   0, 0,  BLUE, WHITE,     0, BLACK, "",       BOX_SHADING }     /* Display background */
  198.    };
  199.  
  200. struct   Image    st_LRImage[] =
  201.    {
  202.       { 0,0, 17, 4, SYSPLANES, is_PropEndData,    0x03, 0x00, NULL },
  203.       { 0,0, 17,20, SYSPLANES, is_PropArrowsData, 0x03, 0x00, NULL },
  204.       { 0,0, 17, 4, SYSPLANES, is_PropEndData,    0x03, 0x00, NULL },
  205.    };
  206.  
  207.  
  208. struct   Gadget   st_LRGadget[FILEIO_GADGETS] =
  209.    {
  210.       { NULL, 0,0, 0,10, GRELWIDTH | GADGHNONE, TOPBORDER,
  211.          SYSGADGET | WDRAGGING, NULL, NULL, NULL, NULL, NULL, NULL, NULL, },
  212.       { NULL, 19,0, 58,11, GADGHCOMP, RELVERIFY,
  213.          BOOLGADGET, NULL, NULL, NULL, NULL, NULL, OPENGADGET_CANCEL, NULL, },
  214.       { NULL, 19,0, 58,11, GADGHCOMP, RELVERIFY,
  215.          BOOLGADGET, NULL, NULL, NULL, NULL, NULL, OPENGADGET_OK, NULL, },
  216.       { NULL, 0,0, 14,7, GADGHCOMP, GADGIMMEDIATE | RELVERIFY,
  217.          BOOLGADGET, NULL, NULL, NULL, NULL, NULL, OPENGADGET_UPGADGET, NULL, },
  218.       { NULL, 0,0, 14,7, GADGHCOMP, GADGIMMEDIATE | RELVERIFY,
  219.          BOOLGADGET, NULL, NULL, NULL, NULL, NULL, OPENGADGET_DOWNGADGET, NULL, },
  220.       { NULL, 0,0, 10,0, GADGIMAGE | GADGHNONE, GADGIMMEDIATE | RELVERIFY | FOLLOWMOUSE,
  221.          PROPGADGET, NULL, NULL, NULL, NULL, NULL, OPENGADGET_PROPGADGET, NULL, },
  222.       { NULL, OPENSELECT_LEFT,OPENSELECT_TOP, 0,0, GADGHNONE, GADGIMMEDIATE,
  223.          BOOLGADGET, NULL, NULL, NULL, NULL, NULL, OPENGADGET_SELECTNAME, NULL, },
  224.    };
  225.  
  226. struct NewWindow st_LRnw =
  227.       {
  228.       0,0,
  229.       0,0,
  230.       BLUE, WHITE,
  231.       GADGETUP | GADGETDOWN | MOUSEMOVE | CLOSEWINDOW | MENUPICK,
  232.       BORDERLESS | SMART_REFRESH | ACTIVATE | NOCAREREFRESH,
  233.       NULL,
  234.       NULL,
  235.       NULL,
  236.       NULL,
  237.       NULL,
  238.       0,0,
  239.       0,0,
  240.       WBENCHSCREEN,
  241.       };
  242.  
  243. struct TextAttr  LRSafeFont          = { (UBYTE *)"topaz.font", TOPAZ_EIGHTY, 0, 0 };
  244. struct IntuiText st_LROpenSelectText = { 3, WHITE, JAM2, 1, 0, &LRSafeFont, NULL, NULL, };
  245. struct Image     st_LRPropImage      = { 1, 0, 8, 0, SYSPLANES, NULL, 0x00, WHITE, NULL, };
  246.  
  247. UBYTE  LRDefaultReqTitle[]   = "iSup Lists Requester";
  248. USHORT LR_Pattern[]          = /* { 0x7f7f, 0x3f3f, 0xdfdf, 0xffff, 0xfdfd, 0xf9f9, 0xf7f7, 0xffff };*/
  249.    {
  250.    0x7b9c,    /* .####.###..###.. */
  251.    0xda7b,    /* ##.##.#..####.## */
  252.    0x3327,    /* ..##..##..#..### */
  253.    0xe5af,    /* ###..#.##.#.#### */
  254.    0x5eac,    /* .#.####.#.#.##.. */
  255.    0xd96a,    /* ##.##..#.##.#.#. */
  256.    0x6b6b,    /* .##.#.##.##.#.## */
  257.    0x1de7,    /* ...###.####..### */
  258.    };
  259.  
  260. BOOL
  261. ls_AllocateData(list)
  262. register struct ListSupport *list;
  263. {
  264.    register USHORT i;
  265.    SHORT d_width, d_height, width, height;
  266.  
  267.    d_width  = (list->MaxChars-1)*8 + 6;
  268.    d_height = list->MaxLines*OPEN_LINEHEIGHT;
  269.    width    = d_width + 45;
  270.    height   = d_height + 12 + 14;
  271.  
  272.    if (  !(list->OpenSelectText = New(struct IntuiText, list->MaxLines))
  273.       || !(list->LRBorder       = New(struct Border,    FILEIO_BORDERS))
  274.       || !(list->LRBox          = New(struct Box,       FILEIO_BOXES))
  275.       || !(list->LRImage        = New(struct Image,     FILEIO_IMAGES))
  276.       || !(list->LRGadget       = New(struct Gadget,    FILEIO_GADGETS))
  277.       )
  278.       {
  279.       ls_DeleteData(list);
  280.       return(FALSE);
  281.       }
  282.  
  283.    CopyMem(st_LRBorder, list->LRBorder, sizeof(struct Border)*FILEIO_BORDERS);
  284.    for(i=1; i<FILEIO_BORDERS; i++) list->LRBorder[i].NextBorder = &list->LRBorder[i-1];
  285.    CopyMem(st_LRBox, list->LRBox, sizeof(struct Box)*FILEIO_BOXES);
  286.    for(i=1; i<FILEIO_BOXES; i++) list->LRBox[i].NextBox = &list->LRBox[i-1];
  287.    CopyMem(st_LRImage, list->LRImage, sizeof(struct Image)*FILEIO_IMAGES);
  288.    for(i=1; i<FILEIO_IMAGES; i++) list->LRImage[i].NextImage = &list->LRImage[i-1];
  289.  
  290.    for(i=0; i<FILEIO_BORDERS; i++)
  291.    if ( !(list->LRBorder[i].XY = New(SHORT, list->LRBorder[i].Count*2)) )
  292.       {
  293.       ls_DeleteData(list);
  294.       return(FALSE);
  295.       }
  296.    list->LRBorder[0].XY[0]  = list->LRBorder[0].XY[2]  = 1;
  297.    list->LRBorder[0].XY[1]  = list->LRBorder[0].XY[7]  = 10;
  298.    list->LRBorder[0].XY[3]  = list->LRBorder[0].XY[5]  = height-1;
  299.    list->LRBorder[0].XY[4]  = list->LRBorder[0].XY[6]  = width-2;
  300.  
  301.    list->LRBorder[1].XY[0]  = list->LRBorder[1].XY[1]  =
  302.    list->LRBorder[1].XY[2]  = list->LRBorder[1].XY[7]  =
  303.    list->LRBorder[1].XY[8]  = list->LRBorder[1].XY[9]  = 0;
  304.    list->LRBorder[1].XY[3]  = list->LRBorder[1].XY[5]  = height-1;
  305.    list->LRBorder[1].XY[4]  = list->LRBorder[1].XY[6]  = width-1;
  306.  
  307.    list->LRBorder[2].XY[0]  = list->LRBorder[2].XY[2]  = width-34;
  308.    list->LRBorder[2].XY[1]  = OPENSELECT_TOP-1;
  309.    list->LRBorder[2].XY[3]  = OPENSELECT_TOP+d_height+4;
  310.  
  311.    list->LRBox[0].Width    = width-2;
  312. /*   list->LRBox[1].LeftEdge = width-81;
  313.    list->LRBox[1].TopEdge  = list->LRBox[2].TopEdge  = height - 17; */
  314.    list->LRBox[1].LeftEdge = OPENSELECT_LEFT-5;
  315.    list->LRBox[1].TopEdge  = OPENSELECT_TOP-1;
  316.    list->LRBox[1].Width    = d_width+29;
  317.    list->LRBox[1].Height   = d_height+4;
  318.  
  319.    if (list->ReqTitle) list->LRBox[0].Text = list->ReqTitle;
  320.    else list->LRBox[0].Text = LRDefaultReqTitle;
  321.  
  322.    list->LRImage[0].LeftEdge = list->LRImage[1].LeftEdge = list->LRImage[2].LeftEdge = width-31;
  323.    list->LRImage[0].TopEdge  = OPENSELECT_TOP+1;
  324.    list->LRImage[1].TopEdge  = OPENSELECT_TOP+6;
  325.    list->LRImage[2].TopEdge  = OPENSELECT_TOP+d_height-3;
  326.  
  327.    CopyMem(st_LRGadget, list->LRGadget, sizeof(struct Gadget)*FILEIO_GADGETS);
  328.    for(i=2; i<FILEIO_GADGETS; i++) list->LRGadget[i].NextGadget = &list->LRGadget[i-1];
  329.  
  330.    if (  !(list->LRGadget[OPENGADGET_PROPGADGET].SpecialInfo  = (APTR)New(struct PropInfo, 1))
  331.       || !(list->LRGadget[OPENGADGET_PROPGADGET].GadgetRender = (APTR)New(struct Image, 1))
  332.       )
  333.       {
  334.       ls_DeleteData(list);
  335.       return(FALSE);
  336.       }
  337.    OpenPropInfo->Flags = FREEVERT | PROPBORDERLESS;
  338.  
  339.    Clone(&st_LRPropImage, OpenPropImage);
  340.  
  341.    /* let's hide the Ok and Cancel gadgets below the big display */
  342.    list->LRGadget[1].TopEdge  = list->LRGadget[2].TopEdge  = height-20;
  343.    /* the others are visible and active */
  344.    list->LRGadget[3].LeftEdge = list->LRGadget[4].LeftEdge = width-30;
  345.    list->LRGadget[3].TopEdge  = OPENSELECT_TOP+7;
  346.    list->LRGadget[4].TopEdge  = OPENSELECT_TOP+18;
  347.    list->LRGadget[5].LeftEdge = width-28;
  348.    list->LRGadget[5].TopEdge  = OPENSELECT_TOP+26;
  349.    list->LRGadget[5].Height   = d_height-29;
  350.    list->LRGadget[6].Width    = d_width;
  351.    list->LRGadget[6].Height   = d_height;
  352.  
  353.    for (i=0; i<list->MaxLines; i++)
  354.        {
  355.        Clone(&st_LROpenSelectText, &list->OpenSelectText[i]);
  356.        list->OpenSelectText[i].TopEdge = 1+(OPEN_LINEHEIGHT*i);
  357.        if (i) list->OpenSelectText[i].NextText = &list->OpenSelectText[i-1];
  358.        if (!(list->OpenSelectText[i].IText = New(UBYTE, list->MaxChars)))
  359.           {
  360.           ls_DeleteData(list);
  361.           return(FALSE);
  362.           }
  363.    }
  364.    return(TRUE);
  365. }
  366.  
  367. VOID
  368. ls_DeleteData(list)
  369. register struct ListSupport *list;
  370. {
  371.    register USHORT i;
  372.    SHORT d_height;
  373.  
  374.    if (list->LRGadget)
  375.       {
  376.       CheckDelete(OpenPropInfo, 1);
  377.       CheckDelete(OpenPropImage, 1);
  378.       Delete(list->LRGadget, FILEIO_GADGETS);
  379.       }
  380.  
  381.    if (list->LRBorder)
  382.       {
  383.       for(i=0; i<FILEIO_BORDERS; i++)
  384.          {
  385.          CheckDelete(list->LRBorder[i].XY, list->LRBorder[i].Count*2);
  386.          }
  387.       Delete(list->LRBorder, FILEIO_BORDERS);
  388.       }
  389.    CheckDelete(list->LRBox,   FILEIO_BOXES);
  390.    CheckDelete(list->LRImage, FILEIO_IMAGES);
  391.  
  392.    if (list->OpenSelectText)
  393.       {
  394.       for(i=0; i<list->MaxLines; i++)
  395.          CheckDelete(list->OpenSelectText[i].IText, list->MaxChars);
  396.       Delete(list->OpenSelectText, list->MaxLines);
  397.       }
  398. }
  399.  
  400. BOOL ls_StartRequester(list, window, x, y)
  401. struct    ListSupport *list;
  402. struct    Window  *window;
  403. SHORT x, y;
  404. {
  405.    SHORT    width, height;
  406.    struct   NewWindow   *nw;
  407.  
  408.    width    = (list->MaxChars-1)*OPEN_LINEHEIGHT + 6 + 45;
  409.    height   = list->MaxLines*OPEN_LINEHEIGHT + 12 + 14;
  410.  
  411.    if (!(nw = New(struct NewWindow, 1))) return(FALSE);
  412.    Clone(&st_LRnw, nw);
  413. /*   if (window && FlagIsSet(list->Flags, LR_AUTO_CENTER))
  414.       {
  415.       x = window->LeftEdge + (window->Width - width)/2;
  416.       y = 10 + window->TopEdge + (window->Height-11 - height)/2;
  417.       } */
  418.    nw->LeftEdge = x;
  419.    nw->TopEdge  = y;
  420.    nw->Width    = width;
  421.    nw->Height   = height;
  422. /*   nw->Screen   = window? window->WScreen : IntuitionBase->FirstScreen;
  423.    is_BindWindowToScreen(nw); */
  424.    list->LRWindow = (struct Window *)OpenWindow(nw);
  425.    Delete(nw, 1);
  426.    if (!list->LRWindow) return(FALSE);
  427.    SetMenuStrip(list->LRWindow, &Menu1);
  428.  
  429.    SetAPen (list->LRWindow->RPort, WHITE);
  430.    SetBPen (list->LRWindow->RPort, BLACK);
  431.    SetAfPt (list->LRWindow->RPort, LR_Pattern, 3);
  432.    RectFill(list->LRWindow->RPort, 0,0, list->LRWindow->Width-1, list->LRWindow->Height-1 );
  433.    SetAfPt (list->LRWindow->RPort, NULL, 0);
  434.  
  435.    if (FlagIsClear(list->Flags, LR_DRAG_BAR_OFF))
  436.       AddGadget(list->LRWindow, &list->LRGadget[OPENGADGET_DRAG], (USHORT) ~0);
  437.    AddGList(list->LRWindow, &list->LRGadget[FILEIO_GADGETS-1], (USHORT) ~0, -1, 0);
  438.    DrawBox(list->LRWindow->RPort, &list->LRBox[FILEIO_BOXES-1], 0,0);
  439.    DrawBorder(list->LRWindow->RPort, &list->LRBorder[FILEIO_BORDERS-1], 0,0);
  440.    DrawImage (list->LRWindow->RPort, &list->LRImage[FILEIO_IMAGES-1], 0,0);
  441.  
  442.    if (FlagIsClear(list->Flags, LR_GOOD_LISTNAMES)) ls_WarmStartFileIO(list);
  443.    else
  444.       {
  445.       list->OpenClickSeconds = list->OpenClickMicros = 0;
  446.       ls_InitOpenProp(list, TRUE);
  447.       ls_StuffSelectNames(list, 2);
  448.       }
  449.    return(TRUE);
  450. }
  451.  
  452. VOID ls_EndRequester(list)
  453. struct     ListSupport *list;
  454. {
  455.    if (!list) return;
  456.    if (list->LRWindow)
  457.       {
  458.       while (FlagIsSet( list->LRWindow->Flags, WINDOWREFRESH )) Delay( 10 ); /* if intuition use it */
  459.       ModifyIDCMP( list->LRWindow, NULL );
  460.       RemoveGList(list->LRWindow, &list->LRGadget[FILEIO_GADGETS-1], -1);
  461.       if (FlagIsClear(list->Flags, LR_DRAG_BAR_OFF))
  462.          RemoveGadget(list->LRWindow, &list->LRGadget[OPENGADGET_DRAG]);
  463.       ClearMenuStrip(list->LRWindow);
  464.       CloseWindow(list->LRWindow);
  465.       list->LRWindow = NULL;
  466.       }
  467. }
  468.